package com.insigma.business.qrcode.appmgt.controller;

import com.insigma.business.qrcode.appmgt.dto.request.CareWelfareTotalSearchRequest;
import com.insigma.business.qrcode.appmgt.dto.response.*;
import com.insigma.business.qrcode.appmgt.service.CareWelfareTotalService;
import com.insigma.business.qrcode.common.vo.BaseResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Api(value = "码上优惠服务统计")
@RequestMapping("/web/careWelfareTotal")
@RestController("careWelfareTotalController")
public class CareWelfareTotalController {
    @Resource
    CareWelfareTotalService careWelfareTotalService;

    @ApiOperation("总体概况")
    @PostMapping("/queryCareWelfareTotal")
    public BaseResponse<CareWelfareTotalResponse> queryCareWelfareTotal(@RequestBody CareWelfareTotalSearchRequest requestDTO) {
        return careWelfareTotalService.queryCareWelfareTotal(requestDTO);
    }

    @ApiOperation("商家类型分布")
    @PostMapping("/queryMerchantTypeTotal")
    public BaseResponse<List<CareWelfareTotalMerchantTypeResponse>> queryMerchantTypeTotal(@RequestBody CareWelfareTotalSearchRequest requestDTO) {
        return careWelfareTotalService.queryMerchantTypeTotal(requestDTO);
    }

    @ApiOperation("各区县商家分布")
    @PostMapping("/queryAreaMerchantTotal")
    public BaseResponse<List<CareWelfareTotalAreaMerchantResponse>> queryAreaMerchantTotal(@RequestBody CareWelfareTotalSearchRequest requestDTO) {
        return careWelfareTotalService.queryAreaMerchantTotal(requestDTO);
    }

    @ApiOperation("商家好评榜")
    @PostMapping("/queryMerchantEvaluationTotal")
    public BaseResponse<List<CareWelfareTotalMerchantEvaluationResponse>> queryMerchantEvaluationTotal(@RequestBody CareWelfareTotalSearchRequest requestDTO) {
        return careWelfareTotalService.queryMerchantEvaluationTotal(requestDTO);
    }

    @ApiOperation("商家折扣")
    @PostMapping("/queryMerchantDiscountTotal")
    public BaseResponse<List<CareWelfareTotalMerchantDiscountResponse>> queryMerchantDiscountTotal(@RequestBody CareWelfareTotalSearchRequest requestDTO) {
        return careWelfareTotalService.queryMerchantDiscountTotal(requestDTO);
    }

    @ApiOperation("各区县优惠情况")
    @PostMapping("/queryAreaMerchantDiscountTotal")
    public BaseResponse<List<CareWelfareTotalAreaMerchantDiscountResponse>> queryAreaMerchantDiscountTotal(@RequestBody CareWelfareTotalSearchRequest requestDTO) {
        return careWelfareTotalService.queryAreaMerchantDiscountTotal(requestDTO);
    }

    @ApiOperation("优惠趋势分析")
    @PostMapping("/queryMerchantDiscountChartTotal")
    public BaseResponse<List<CareWelfareTotalMerchantDiscountChartResponse>> queryMerchantDiscountChartTotal(@RequestBody CareWelfareTotalSearchRequest requestDTO) {
        return careWelfareTotalService.queryMerchantDiscountChartTotal(requestDTO);
    }
}
